package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.sys.modular.system.entity.TaskFlow;
import cn.stylefeng.guns.sys.modular.system.model.params.TaskFlowParam;
import cn.stylefeng.guns.sys.modular.system.model.result.TaskFlowResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jiangge
 * @since 2020-09-10
 */
@Mapper
public interface TaskFlowMapper extends BaseMapper<TaskFlow> {

    /**
     * 获取列表
     *
     * @author jiangge
     * @Date 2020-09-10
     */
    List<TaskFlowResult> customList(@Param("paramCondition") TaskFlowParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jiangge
     * @Date 2020-09-10
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TaskFlowParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jiangge
     * @Date 2020-09-10
     */
    Page<TaskFlowResult> customPageList(@Param("page") Page page, @Param("paramCondition") TaskFlowParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jiangge
     * @Date 2020-09-10
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TaskFlowParam paramCondition);

    /**
     * 新增流程明细表
     * @param taskFlow
     */
    int add(TaskFlow taskFlow);

    int addList(@Param("list") List<TaskFlow> taskFlows);

    List<TaskFlowResult> proTaskFolwList(@Param("param") TaskFlowParam taskFlowParam);

    /**
     * 获取任务时间
     * @param proId
     * @param taskId
     * @return
     */
    String getTime(@Param("proId") Integer proId, @Param("taskId") Integer taskId);
}
